package com.rgs.se.java8new.lambda;

import java.util.Optional;

/**
 * @author Ren Gaoshuai
 * @ClassName TestMain
 * @date 2022-05-01 21:05
 **/
public class TestMain {

    public static void main(String[] args) {
        MyClass myClass = new MyClass();
        myClass.method1("test", new MyInterface() {

            @Override
            public void apply() {
                //这里写具体的逻辑
            }
        });

        String s = Optional.ofNullable("string").orElseGet(() ->getStringName());
    }

    public static String getStringName(){
        return "sjdew";
    }


}
